<template>
	<view>
		<view class="content">
			<h1>选择预约时间</h1>
			<ul class="times">
				<li v-for="(item,index) in timeData" :key="index" @click="selectTime(item)">{{item.ghsj00}}<view class="icons"></view></li>
			</ul>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				params:{},
				timeData:[]
			}
		},
		onLoad(option) {
			if(option.item){
				this.params=option.item;
				this.init(option.item);
			}
			
		},
		methods: {
			init(item){
				
				let data={
					"mzksbh":item.mzksbh,
					"ksysbh":item.ksysbh,
					"hybh00":item.hybh00,
					"ywlsh0":""+new Date().getTime(),
					"funid":"F07.09.02.03"
				}
				this.$postJson("/qnyesb/qnyesbproxy",data,res=>{
					if(res.state==0){
						this.timeData=res.data.retrieve;
					}else{
						uni.showToast({
							title:res.message,
							icon:"none",
							duration:3000
						})
					}
				})
			},
			selectTime(item){
				this.params=item;
				var paramsStr=JSON.stringify(this.params);
				uni.navigateTo({
					url:"../appointmentDetail/appointmentDetail?data="+paramsStr
				})
			}
		}
	}
</script>

<style>
.content h1{
	padding: 20px;
}
.times{
	width: 100%;
}
.times li{
	width: 96%;
	background: #FFFFFF;
	height: 56px;
	line-height: 56px;
	margin: 0 auto;
	margin-top: 10px;
	font-size: 16px;
	text-indent: 1em;
	font-weight: 400;
	border-radius: 8px;
	
}
.times .icons{
	float: right;
	width: 24px;
	height: 24px;
	background-image: url(../../static/102@2x.png);
	background-size: 100% 100%;
	margin-top: 20px;
	margin-right: 16px;
}
</style>
